<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        let Car = class Car {
            static brand = "a"
            static displayInfo(brand) {
                console.log(brand)
            }
            constructor (color) {
                this.color = color
                this.getColor = () => {
                    console.log(this.color)
                } 
            }
            getAge() {
                let year = new Date().getFullYear() - this.year
                console.log(year)
            }
        }
        Car.prototype.year = 2021;

        let car = new Car("red");
        console.log(car)
        console.log(car.color)
        console.log(Car.brand)
        console.log(car.year)
        Car.displayInfo("b")
        car.getColor()
        car.getAge()

    </script>
</body>
</html>